import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Layout from "./components/Layout";
import Home from "./components/Home";
import UserList from "./components/UserList";
import UserRoleSetting from "./components/UserRoleSetting"; // 新增导入
import Login from "./components/Login";
import Register from "./components/Register";
import Profile from "./components/Profile";
import MovieList from "./components/MovieList";
import MovieAdd from "./components/MovieAdd";
import ScheduleAdd from "./components/ScheduleAdd";
import ScheduleList from "./components/ScheduleList"; // 添加这一行
import TicketSales from "./components/TicketSales"; // 已有的导入
import TicketView from "./components/TicketView"; // 新增导入
import "./App.css";

export default function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Layout />}>
          <Route index element={<Home />} />
          <Route path="users" element={<UserList />} />
          <Route path="users/role/setting" element={<UserRoleSetting />} />{" "}
          {/* 新增路由 */}
          <Route path="profile" element={<Profile />} />
          <Route path="movies" element={<MovieList />} />
          <Route path="movies/add" element={<MovieAdd />} />
          <Route path="schedules/add" element={<ScheduleAdd />} />
          <Route path="schedules" element={<ScheduleList />} /> // 添加这一行
          <Route
            path="tickets/sales/:scheduleId?"
            element={<TicketSales />}
          />{" "}
          // 已有的路由
          <Route path="tickets/view" element={<TicketView />} /> // 新增路由
        </Route>
        <Route path="/login" element={<Login />} />
        <Route path="/register" element={<Register />} />
      </Routes>
    </Router>
  );
}
